#include "AppManager.h"

class AppDemoSGP30 : public AppBase
{
private:
    /* data */
public:
    AppDemoSGP30()
    {
        name = "demosgp30";
        title = "SGP30";
        description = "空气质量传感";
        image = NULL;
        peripherals_requested = PERIPHERALS_SGP30_BIT;
        _showInList = true;
    }
    void setup();
};
static AppDemoSGP30 app;

void AppDemoSGP30::setup()
{
    peripherals.load_append(PERIPHERALS_SGP30_BIT);
    uint16_t TVOC,eCO2;
    TVOC = peripherals.sgp.TVOC;
    eCO2 = peripherals.sgp.eCO2;
    char datbuf[40];
    sprintf(datbuf, "TVOC: %g ppb\neCO2: %g ppm\n", TVOC,eCO2);
    Serial.printf(datbuf);
    GUI::msgbox("传感器信息",datbuf);
    appManager.goBack();
}

